home *** CD-ROM | disk | FTP | other *** search
/ SVM Mac 58 / CD-ROM N°58.iso / navigateurs / Netscape Folder / chrome / messengercompose / content / default / askSendFormat.js < prev    next >
Encoding:
Text File  |  2000-04-19  |  2.1 KB  |  76 lines  |  [TEXT/MOSS]

  1. var msgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat;
  2. var param = null;
  3.  
  4. function Startup()
  5. {
  6.     /* dump("Startup()\n"); */
  7.  
  8.     if (window.arguments && window.arguments[0] && window.arguments[0])
  9.     {
  10.         param = window.arguments[0];
  11.         param.abort = true;         //if the user hit the close box, we will abort.
  12.         if (param.action)
  13.         {
  14.             //Set the default radio array value
  15.             var element = document.getElementById("SendPlainTextAndHtml");
  16.             element.checked = true;
  17.             
  18.             //change the button label
  19.             labels = document.getElementById("okCancelButtons");
  20.             element = document.getElementById("ok");
  21.             element.setAttribute("value", labels.getAttribute("button1Label"));
  22.             element = document.getElementById("cancel");
  23.             element.setAttribute("value", labels.getAttribute("button2Label"));
  24.             element = document.getElementById("Button2");
  25.             element.setAttribute("value", labels.getAttribute("button3Label"));
  26.             element.setAttribute("style", "display:inline");
  27.             element.setAttribute("disabled", "true");
  28.             element = document.getElementById("Button3");
  29.             element.setAttribute("value", labels.getAttribute("button4Label"));
  30.             element.setAttribute("style", "display:inline");
  31.             element.setAttribute("disabled", "true");
  32.             
  33.             //set buttons action
  34.             doSetOKCancel(Send, DontSend, Recipients, Help);
  35.  
  36.            moveToAlertPosition();
  37.         }
  38.     }
  39.     else 
  40.     {
  41.         dump("error, no return object registered\n");
  42.     }
  43.  
  44. }
  45.  
  46. function Send()
  47. {
  48.     if (param)
  49.     {
  50.         if (document.getElementById("SendPlainTextAndHtml").checked)
  51.             param.action = msgCompSendFormat.Both;
  52.         else if (document.getElementById("SendPlainTextOnly").checked)
  53.             param.action = msgCompSendFormat.PlainText;
  54.         else if (document.getElementById("SendHtmlOnly").checked)
  55.             param.action = msgCompSendFormat.HTML;
  56.         param.abort = false;
  57.     }
  58.     return true;
  59. }
  60.  
  61. function DontSend()
  62. {
  63.     if (param)
  64.         param.abort = true;
  65.     return true;
  66. }
  67.  
  68. function Recipients()
  69. {
  70.     return false;
  71. }
  72.  
  73. function Help()
  74. {
  75.     return false;
  76. }